
// A2_summarize_f_stats
//==============================================================================

// Description: This file creates a summary file for the f-statistics across sectors

clear
set more off

cd "D:\data_replication"

forval i = 1/4092 {
import delimited statistics_and_graphs/f_statistics/output_files/Fstat_`i'.csv, clear
keep if _n == 8
replace v2 = subinstr(v2,"=","",.)
replace v2 = subinstr(v2, `"""',  "", .)
destring v2, gen(F_stat)
rename v2 F_stat_string
save statistics_and_graphs/f_statistics/output_files/Fstat_`i'.dta, replace
}

use statistics_and_graphs/f_statistics/output_files/Fstat_1.dta, clear
rm statistics_and_graphs/f_statistics/output_files/Fstat_1.dta
forval i = 2/4092 {
append using statistics_and_graphs/f_statistics/output_files/Fstat_`i'.dta
rm statistics_and_graphs/f_statistics/output_files/Fstat_`i'.dta
}

save statistics_and_graphs/f_statistics/F_stats_summary.dta, replace

